/*
 * Copyright (C) Cátedra SAES-UMU 2011 <pedromateo@um.es>
 *
 * Android HCI Extractor is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Android HCI Extractor is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.mmi.android.instrumentation.viewproxies;

import java.util.LinkedList;

import org.mmi.android.instrumentation.utils.StringUtils;

import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;


/**
 * Content-proxy class for RadioButton objects.
 * 
 * @author pedro mateo (pedromateo@um.es)
 *
 */
public class RadioButtonProxy extends BaseViewProxy {

	public RadioButtonProxy() {
		super();
		// TODO Auto-generated constructor stub
	}

	///
	/// BaseViewProxy abstract methods implementation
	///
	
	@Override
	public int getElements(View v) {
		int nelems = 0;
		//one element for the widget
		nelems++;
		//one element for each word in the text
		String text = (String) ((RadioButton)v).getText();
		nelems += StringUtils.countWords(text);
		return nelems;
	}
	
	@Override
	public boolean isQuestion(View v) {
		// TODO
		return false;
	}
	
	@Override
	public int getConcepts(View v) {
		// TODO
		return 0;
	}
	
	@Override
	public int getNoise(View v) {
		// TODO
		return 0;
	}

	@Override
	public boolean isFeedback(View v) {
		return false;
	}
	
	@Override
	public LinkedList<Class> getAdaptedClasses(){
		LinkedList<Class> adapted = new LinkedList<Class>();
		adapted.add(RadioButton.class);

		return adapted;
	}

}
